<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="test.css" type="text/css" media="screen" rel="stylesheet" />
<script src="../jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function(){
					var body = $(document.body);

					//插入_ajax浮动层
			body.append('<div id="test"></div>');
			$("#button").click(function(){
			//alert($.kc_href());
					var bwidth = $(window).width();       //获得浏览器的宽
					var bheight = $(window).height();	  //获得浏览器的高
					var cwidth = $("#set_position_window").width();   //获得当前窗体的宽
					var cheight = $("#set_position_window").height(); //获得当前窗体的高
					 
					 /*计算出居中的左边距*/
					var left = (bwidth-cwidth)/2;  
					 /*计算出居中的上边距*/
					var top = (bheight-cheight)/2; 
				$("#test").css("left",0).css("top",0).fadeIn("slow");	
				$("#set_position_window").css("left",left).css("top",top).fadeIn("slow");
			});
			
			$("#close").click(function(){
				$("#set_position_window").fadeOut("slow");
				$("#test").fadeOut("slow");	
			});
			
			//$("p").fadeIn("slow",function(){
   			//	alert("Animation Done.");
 			//});
});
$.kc_close=function(){//隐藏ajax
	$('html').css('overflow','');
	$('#test').empty();
}
$.kc_href=function(){//获得当前页地址
	var s=parent.location.href;
	var num;
	num=s.indexOf('#');
	if(num>0) s=s.substring(0,num);
	num=s.indexOf('?');
	if(num>0) s=s.substring(0,num);
	return s;
}
</script>
</head>

<body>
<input name="button"  id="button" type="button"  value="button"/>
<div id="set_position_window">
    	<div id="close">关闭</div>
    	<div id="set_position_title">授权窗口</div>
    	<div id="set_position_content"></div>
</div>
<p>sdfasdfasdfqwerqwer</p>
</body>
</html>
